package sort;

import java.util.Scanner;

/**
 * \* Created with IntelliJ IDEA.
 * \* User: Administrator
 * \* Date: 2022/4/16
 * \* Time: 15:19
 * \* To change this template use File | Settings | File Templates.
 * \* Description:
 * \
 */
public class shell {
    public static void shell1(int[] array,int gap){
        for (int i = gap; i < array.length; i++) {
            int tmp = array[i];
            int j = i-gap;
            for (; j >=0 ; j -= gap) {
                if(array[j] > tmp){
                    array[j+gap] = array[j];
                }else {
                    break;
                }
            }
            array[j+gap] = tmp;
        }
    }
    public static void shellSort(int []array){
        int[] drr= {5,3,1};
        for (int i=0;i<drr.length;i++){
            shell1(array,drr[i]);
        }
    }
    public static void insertSort(int[] array){
        for(int i =1;i<array.length;i++){
            int tmp = array[i];
            int j = i-1;
            for (; j >=0;j--) {
                if(array[j+1] > array[j]){
                    array[j+1] = array[j];
                }
                break;
            }
            array[j+1] = tmp;

        }
    }


    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        System.out.println(getCount(n));

    }
    public static int getCount(int n){
        if(n == 1 || n==2 ) return 1;
        return getCount(n-1)+(n-2);
    }


    public static void insertSort1(int[] array){
        for(int i =1;i<array.length;i++){
            int tmp = array[i];
            for(int j =i-1;i>=0;j--){
                if(array[tmp] >array[j]){
                    array[tmp] = array[j];
                }else {
                    break;
                }
                array[j+1] = tmp;
            }
        }
    }
}
